﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PetaPoco;

namespace ZhongheCms.Models
{
    public partial class GswTblJobCustomer
    {

        [ResultColumn]
        public List<GswTblBaseInfo> BaseInfos { get; set; } 
        public static List<GswTblJobCustomer> GetCustomer(string tname,int cusid)
        {
            var sql = "select * from GswTblJobCustomer where delFlag=0 and ParentId="+cusid;
            if (!string.IsNullOrEmpty(tname))
                sql += " and (CusShortName like '%" + tname + "%' or CustomerName like '%" + tname + "%' or Contact like '%" + tname + "%')";
            sql += " order by id desc";
            var qry = Fetch(sql);
            return qry;
        }
    }
}